package com.qyhl.shop.shop.gift;

import com.qyhl.webtv.commonlib.entity.shop.ShopGiftListBean;

import java.util.List;

public class ShopGiftListPresenter implements ShopGiftListContract.ShopGiftListPresenter {
    private ShopGiftListContract.ShopGiftListView mView;
    private ShopGiftListModel mModel;

    public ShopGiftListPresenter(ShopGiftListContract.ShopGiftListView mView) {
        this.mView = mView;
        this.mModel = new ShopGiftListModel(this);
    }

    @Override
    public void getList(int page, int range) {
        mModel.getList(page, range);
    }

    @Override
    public void setList(List<ShopGiftListBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setError("暂无任何礼品！");
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }
}
